package cn.edu.scau.cmi.liqiquan.simpleFactory;

public class SampleFactory {
	public SampleFactory() {
		
	}
	
	public static Insurance createInsurance(String type) {
		Insurance insurance = null;
		switch(type) {
		case "Injury":
			insurance = new InjuryInsurance();
			break;
		case "AutomobileDamage":
			insurance = new AutomobileDamageInusrance();
			break;
		case "Casualties":
			insurance = new CasualtiesInsurance();
			break;
		case "Accident":
			insurance = new AccidentInsurance();
			break;
			default : break;
		}
		
		return insurance;
	}
}
